---
layout: m1x_soap
title: Customer Update
---

<h2><a name="customer.update-Module%3AMageCustomer"></a>Module: Mage_Customer</h2>


<h3><a name="customer.update-Resource%3Acustomer"></a>Resource: customer</h3>


<h4><a name="customer.update-Method%3A"></a>Method:</h4>

<ul>
	<li>customer.update (SOAP V1)</li>
	<li>customerCustomerUpdate (SOAP V2)</li>
</ul>


<p>Update information about the required customer. Note that you need to pass only those arguments which you want to be updated.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> int </td>
<td> customerId </td>
<td> Customer ID </td>
</tr>
<tr>
<td> array </td>
<td> customerData </td>
<td> Array of customerCustomerEntityToCreate </td>
</tr>
</tbody></table>


<p><b>Returns</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> boolean </td>
<td> True if the customer is updated </td>
</tr>
</tbody></table>


<p>The <b>customerCustomerEntityToCreate</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> int </td>
<td> customer_id </td>
<td> Customer ID </td>
</tr>
<tr>
<td> string </td>
<td> email </td>
<td> Customer email </td>
</tr>
<tr>
<td> string </td>
<td> firstname </td>
<td> Customer first name </td>
</tr>
<tr>
<td> string </td>
<td> lastname </td>
<td> Customer last name </td>
</tr>
<tr>
<td> string </td>
<td> password </td>
<td> Customer password </td>
</tr>
<tr>
<td> int </td>
<td> group_id </td>
<td> Group ID </td>
</tr>
<tr>
<td> string </td>
<td> prefix </td>
<td> Customer prefix </td>
</tr>
<tr>
<td> string </td>
<td> suffix </td>
<td> Customer suffix </td>
</tr>
<tr>
<td> string </td>
<td> dob </td>
<td> Customer date of birth </td>
</tr>
<tr>
<td> string </td>
<td> taxvat </td>
<td> Customer tax/VAT number </td>
</tr>
<tr>
<td> int </td>
<td> gender </td>
<td> Customer gender: 1 - Male, 2 - Female </td>
</tr>
<tr>
<td> string </td>
<td> middlename </td>
<td> Customer middle name/initial </td>
</tr>
</tbody></table>


<h4><a name="customer.update-Examples"></a>Examples</h4>

<h5><a name="customer.update-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires api authentification,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');

$result = $client-&gt;call($session, 'customer.update', array('customerId' =&gt; '2', 'customerData' =&gt; array('firstname' =&gt; 'John', 'lastname' =&gt; 'Doe', 'email' =&gt; 'test@example.com', 'password' =&gt; 'john22')));
var_dump ($result);

// If you don't need the session anymore
//$client-&gt;endSession($session);</pre>
		</div>
</div></div>

<h5><a name="customer.update-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

// If some stuff requires api authentification,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');
$result = $client-&gt;customerCustomerUpdate($session, '2', array('email' =&gt; 'customer-mail@example.org', 'firstname' =&gt; 'Dough', 'lastname' =&gt; 'Deekson', 'password' =&gt; 'password', 'website_id' =&gt; 1, 'store_id' =&gt; 1, 'group_id' =&gt; 1));

var_dump ($result);</pre>
		</div>
</div></div>




<h5><a name="customer.update-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;customerCustomerUpdate((object)array('sessionId' =&gt; $sessionId-&gt;result, 'customerId' =&gt; '2', 'customerData' =&gt;  ((object)array(
'email' =&gt; 'customer-mail@example.org',
'firstname' =&gt; 'Dough',
'lastname' =&gt; 'Deekson'
))));   
var_dump($result-&gt;result);</pre>
		</div>
</div></div>

<?php include(__ROOT__ . 'footer.php'); ?>
